package com.wsq.retrofitdemo.model.request;

import com.wsq.retrofitdemo.utils.Constants;
import com.wsq.retrofitdemo.utils.GenerateSign;

import java.util.HashMap;
import java.util.Map;

/**
 * Date:2021/9/2
 * Time:15:36
 * author:wushengqi
 */
public class IFlyTaskAddReq extends IFlyBase{
    public String third_user_id;
    //任务类型
    //任务类型：
    //0 ：训练个性化
    //合成音库
    //1：训练音色转
    //换音库；
    //默认为 0； 2：个性化 2.0 合 成3：个性化 2.0 极 速合成
    public int task_type;
    public String name;

    @Override
    public String sign() {
        Map<String, String> map = new HashMap<>();
        map.put("third_user_id",third_user_id);
        map.put("task_type",task_type+"");
        map.put("name",name);
        map.put("clientType",clientType+"");
        try {
            return sign = GenerateSign.generateSign(openid, Constants.OPEN_KEY, "", map);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "";
    }

    @Override
    public Map<String, String> getMap() {
        Map<String, String> map = new HashMap<>();
        map.put("third_user_id",third_user_id);
        map.put("task_type",task_type+"");
        map.put("name",name);
        map.put("clientType",clientType+"");
        map.put("sign",sign);
        map.put("openid",openid);
        return map;
    }
}
